package com.xmhmyh.generalframework.project.systool.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xmhmyh.generalframework.common.BaseServiceImpl;
import com.xmhmyh.generalframework.project.systool.entity.TableColumn;
import com.xmhmyh.generalframework.project.systool.mapper.TableColumnMapper;
import com.xmhmyh.generalframework.project.systool.service.ITableColumnService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 于丁
 * @Description: 服务实现
 * @DateTime: 2020/8/6 1:51 下午
 * @Params:
 * @Return
 */
@Service
public class TableColumnServiceImpl extends BaseServiceImpl<TableColumnMapper, TableColumn> implements ITableColumnService {



    @Override
    public void removeByTableId(Long tableId) {
        LambdaQueryWrapper<TableColumn> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TableColumn::getTableId, tableId);
        remove(queryWrapper);
    }


    @Override
    public List<TableColumn> getByTableId(Long tableId) {
        LambdaQueryWrapper<TableColumn> query = new LambdaQueryWrapper<>();
        query.eq(TableColumn::getTableId, tableId);
        return list(query);
    }
}
